﻿using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Primitives;
using Quickuse.Logging.HttpLogger;
using System;
using System.Collections.Generic;
using System.Text;

namespace Quickuse.Logging.EsLogger
{
    /// <summary>
    /// 
    /// </summary>
    internal interface IEsLoggerSettings
    {
        /// <summary>
        /// 应用标识
        /// </summary>
        string AppId { get; }

        /// <summary>
        /// ClusterSeq
        /// </summary>
        string ClusterSeq { get; }

        /// <summary>
        /// IncludeScopes (默认 true)
        /// </summary>
        bool IncludeScopes { get; }

        /// <summary>
        /// IsAsyn
        /// </summary>
        bool IsAsyn { get; }

        /// <summary>
        /// Levels
        /// </summary>
        List<LogLevel> Levels { get; }

        /// <summary>
        /// EsServer
        /// </summary>
        string EsServer { get; }

        /// <summary>
        /// 索引名
        /// </summary>
        string IndexName { get; }

        /// <summary>
        /// 索引名日志格式
        /// </summary>
        string IndexNameDtFormat { get; }

        /// <summary>
        /// 类型名
        /// </summary>
        string TypeName { get; }

        /// <summary>
        /// Timeout (默认 2000)
        /// </summary>
        int Timeout { get; }

        /// <summary>
        /// TaskWaitTime
        /// </summary>
        TimeSpan TaskWaitTime { get; }

        /// <summary>
        /// ChangeToken
        /// </summary>
        IChangeToken ChangeToken { get; }

        /// <summary>
        /// TryGetSwitch
        /// </summary>
        /// <param name="prefix">prefix</param>
        /// <param name="level">level</param>
        /// <returns></returns>
        bool TryGetSwitch(string prefix, out LogLevel level);

        /// <summary>
        /// Reload
        /// </summary>
        /// <returns></returns>
        IEsLoggerSettings Reload();

        string TestIndexName { get; }
    }
}
